home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 24
/
024.d81
/
input demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
77 lines
1 poke53280,0:poke53281,0
51 c$=chr$(147)
55 print c$:print"type in something"
58 print"notice the action of clr/home and cursor keys":print
59 def "34=0"
60 input a$
65 :
70 rem predefined strings for def key command
72 nokey$="1-255=0"
76 crsr$="13=_,17=_,29=_,145=_,157=_,20=20,19=19,147=_,148=_"
78 n$="u='4,i='5,o='6,j='1,k='2,l='3,32='0,.=.,+=+,-=-,'0-'9=_"
80 numkey$=nokey$+","+n$+","+crsr$+",34=0"
82 f$="133='1,134='3,135='5,136='7,137='2,138='4,139='6,140='8"
84 fkey$=nokey$+","+f$
86 box$=nokey$+",a-z=_,13=_,19=_,147=_,157=_,20=2,29=_"
90 :
100 print c$:print"just try to get out of the box"
101 print"notice how the delete key works"
102 print"use shift-clr/home to clear box"
105 def box$
110 (NULL) 12,10:print"[176][195][195][195][195][195][195][195][195][195][195][195][195][174]"
120 (NULL) 12,11:print"[194] [194]"
130 (NULL) 12,12:print"[173][195][195][195][195][195][195][195][195][195][195][195][195][189]"
150 (NULL) 13,11:input\11,x$
180 print c$:print"fill in the blank"
186 (NULL) 5,10:print"there are eight in a byte"
190 (NULL) 21,10:input\4,a$
191 print:print
194 if a$="bits" then print"right on!"
195 if a$<>"bits" then print"sorry, the answer is bits"
196 (NULL) 14,18:input\1,"press return ";x$
199 :
200 print c$
201 print"notice that only numbers can be typed"
210 (NULL) 5,5:print"67+84="
220 def nokey$+",'0-'9=_,"+crsr$
230 (NULL) 12,5:input\3,n
300 :
400 def numkey$
405 (NULL) 1,1:print c$;"notice numerical keypad"
406 print"uio jkl space bar"
410 (NULL) 5,5:input\19,"enter a number ";n
411 print c$
415 :
450 def nokey$+",y=y,n=n"
455 (NULL) 10,10:print"answer y or n"
460 get k$:if k$="" then 460
490 :
500 def fkey$ :rem define function keys
505 print c$:print"press function keys"
506 print"f8 to quit"
510 get k:if k=0 then 510
511 def:print:print
515 on k gosub 610,620,630,640,650,660,670,680
516 def "1-255=0,13=13"
520 input"press return";g$
530 goto 500
610 print"f1 routine":return
620 print"f2 routine":return
630 print"f3 routine":return
640 print"f4 routine":return
650 print"f5 routine":return
660 print"f6 routine":return
670 print"f7 routine":return
680 print"f8 routine"
790 :
800 printc$;"press f7 at any time for help"
805 def:def"136=1":rem def f7 as hot key
810 print:print
820 input 850,"enter something: ";x$
830 goto 820
850 print:print:print"you called for help?"
851 print"notice how f7 caused basic to jump out of the input statement"
855 print"this is the end of the demo"
860 print:print"good bye"
999 def